# $Id$
# Maintainer: AndyRTR <andyrtr@archlinux.org>
# Contributor: Thomas Arnhold <thomas at arnhold dot org>

pkgname=libe-book
pkgver=0.1.2
pkgrel=7
pkgdesc="Library for import of reflowable e-book formats."
arch=('i686' 'x86_64')
url="http://sourceforge.net/projects/libebook/"
license=('LGPL2.1' 'MPL')
depends=('librevenge' 'libxml2')
makedepends=('gperf' 'boost' 'cppunit' 'doxygen')
source=(https://sourceforge.net/projects/${pkgname//-/}/files//${pkgname}-${pkgver}/${pkgname}-${pkgver}.tar.xz
        0001-Disable-werror-by-default-since-gperf-code-will-not-.patch
        boost159.patch)
sha1sums=('950ee08e7a41585636aebb7774fdc6f05817a18c'
          '7d38227479fd993e0a736115b53f00745a8a987c'
          '8b5b88a05db43773aae486c8410c9bb79e0f6d16')

prepare() {
  cd ${pkgname}-${pkgver}
  # https://sourceforge.net/p/libebook/code/ci/784c5168d1a62618e53619fd0a979363d596775a/
  patch -Np1 -i ../0001-Disable-werror-by-default-since-gperf-code-will-not-.patch
  patch -Np1 -i ../boost159.patch
  autoreconf -vi
}

build() {
  cd ${pkgname}-${pkgver}
  ./configure --prefix=/usr #--disable-werror
  make
}

check() {
  cd ${pkgname}-${pkgver}
  make check
}

package() {
  cd ${pkgname}-${pkgver}
  make DESTDIR=$pkgdir install
}

